//For reassignment of sharkpool leads

trigger OOR_Reassign_SharkpoolLeads on Lead (before insert) {
    Public ID LocalAdsLeadRecordType = RecordTypeHelper.GetRecordTypeID('Lead', 'Local Advertiser');
    List<Lead> leadList = new List<Lead>();  
    Map<Id,Lead> LeadMap = new Map<Id,Lead>();
        for(Lead leads:Trigger.new){
            String OwnerCheck=leads.OwnerId;
            if(OwnerCheck.Startswith('00G') && leads.RecordtypeId == LocalAdsLeadRecordType){
                    leadList.add(leads);
                    LeadMap.put(leads.Id,leads);
            }
        }
    if(leadList.size()>0){
    //Calling the Roundrobin class for newly inserted leads
        OORLeadRoundRobinQueue.executeRoundRobin(leadList,LeadMap);
    }
}